package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CreditGoodsMapper;
import com.ruoyi.system.domain.CreditGoods;
import com.ruoyi.system.service.ICreditGoodsService;

/**
 * 商品信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-01-01
 */
@Service
public class CreditGoodsServiceImpl implements ICreditGoodsService 
{
    @Autowired
    private CreditGoodsMapper creditGoodsMapper;

    /**
     * 查询商品信息
     * 
     * @param goodsId 商品信息主键
     * @return 商品信息
     */
    @Override
    public CreditGoods selectCreditGoodsByGoodsId(Long goodsId)
    {
        return creditGoodsMapper.selectCreditGoodsByGoodsId(goodsId);
    }

    /**
     * 查询商品信息列表
     * 
     * @param creditGoods 商品信息
     * @return 商品信息
     */
    @Override
    public List<CreditGoods> selectCreditGoodsList(CreditGoods creditGoods)
    {
        return creditGoodsMapper.selectCreditGoodsList(creditGoods);
    }

    /**
     * 查询可用的商品信息列表
     * 
     * @return 商品信息
     */
    @Override
    public List<CreditGoods> selectAvailableCreditGoodsList()
    {
        return creditGoodsMapper.selectAvailableCreditGoodsList();
    }

    /**
     * 查询推荐商品信息列表
     * 
     * @return 商品信息
     */
    @Override
    public List<CreditGoods> selectRecommendedCreditGoodsList()
    {
        return creditGoodsMapper.selectRecommendedCreditGoodsList();
    }

    /**
     * 新增商品信息
     * 
     * @param creditGoods 商品信息
     * @return 结果
     */
    @Override
    public int insertCreditGoods(CreditGoods creditGoods)
    {
        return creditGoodsMapper.insertCreditGoods(creditGoods);
    }

    /**
     * 修改商品信息
     * 
     * @param creditGoods 商品信息
     * @return 结果
     */
    @Override
    public int updateCreditGoods(CreditGoods creditGoods)
    {
        return creditGoodsMapper.updateCreditGoods(creditGoods);
    }

    /**
     * 批量删除商品信息
     * 
     * @param goodsIds 需要删除的商品信息主键
     * @return 结果
     */
    @Override
    public int deleteCreditGoodsByGoodsIds(Long[] goodsIds)
    {
        return creditGoodsMapper.deleteCreditGoodsByGoodsIds(goodsIds);
    }

    /**
     * 删除商品信息信息
     * 
     * @param goodsId 商品信息主键
     * @return 结果
     */
    @Override
    public int deleteCreditGoodsByGoodsId(Long goodsId)
    {
        return creditGoodsMapper.deleteCreditGoodsByGoodsId(goodsId);
    }
} 